﻿@model CodeCamp.Models.Home.HomeIndexViewModel

    <div id="sponsorsContainer" class="widget rounded-10">

        <h3>Sponsors</h3>

        <ul class="sponsors" style="display:none;">
        @{
            if ((@Model == null)  || (Model.Sponsors.Count == 0))
            {
                <li><a href="/"></a></li>
            }
            else
            {
                //no @ needed here now that the <li></li> are inside foreach curley braces
                foreach(var sponsor in @Model.Sponsors)
                {
                <li>
                <a href="@Html.Encode(@sponsor.Url)" target="_blank">
                  <img src="@Html.Encode(@sponsor.ImageUrl)" alt="@Html.Encode(@sponsor.Name)" 
                    width="@Html.Encode(@sponsor.ImageWidth)" height="@Html.Encode(@sponsor.ImageHeight)"  border="0" />
                </a>
                </li>
                }
            }
        }
        </ul>

    </div>

    @Html.Partial("SidebarCommonPartial")
